<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => '...',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<section id="drudgery">
	<h2>University drudgery</h2>
	<p>
		More drudgery ...
	</p>
	<blockquote>
		<p>
			Indeed, we can&apos;t connect the dots with a straight line.
			However, we actually need <strong>*three*</strong> pieces for this, not two.
			On January 01, the price was \$10.
			On January 31, the price was \$12.
			That&apos;s one segment right there.
			On February 01, the price didn&apos;t change; it remained at \$12.
			January 31 and February 01 are not the same day!
			We thus need a one-day segment connecting January 31 to February 01.
			Lastly, on February 28, the price was \$9, resulting in a third segment.
		</p>
		<p>
			To turn this into a piecewise function, we need to translate the dates into numbers somehow.
			Let&apos;s use the day index into the year as the number.
			That means that January 01 is <code>0</code>, January 31 is <code>30</code>, February 01 is <code>31</code>, and February 28 is <code>58</code>.
			Using that scheme, we can build the following piecewise function:
		</p>
		<div style="display: table;">
			<p style="display: table-row;">
				<span style="display: table-cell; vertical-align: middle;">
					f(x) =
				</span>
				<span style="display: table-cell; font-size: 5em; vertical-align: middle;">
					{
				</span>
				<span style="display: table-cell; vertical-align: middle;">
					x / 15 + 10, if 0 ≤ x ≤ 30<br/>
					12, if 30 ≤ x ≤ 31<br/>
					(129 - x) / 9, if 31 ≤ x ≤ 58
				</span>
			</p>
		</div>
		<p>
			It&apos;s worth noting that the middle segment overlaps with each of the other segments at its ends, but no matter which of the two possible equations you use at those two points, you&apos;ll get the same answer.
		</p>
	</blockquote>
</section>
END
);
